home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-21 | 778 b | 67 lines | [TEXT/CWIE] |
- #include <iostream.h>
-
-
- //--------------------------------------- Root
-
- class Root
- {
- public:
- Root();
- };
-
- Root::Root()
- {
- cout << "Root constructor called\n";
- }
-
-
- //--------------------------------------- Base1
-
- class Base1 : public Root
- {
- public:
- Base1();
- };
-
- Base1::Base1()
- {
- cout << "Base1 constructor called\n";
- }
-
-
- //--------------------------------------- Base2
-
- class Base2 : public Root
- {
- public:
- Base2();
- };
-
- Base2::Base2()
- {
- cout << "Base2 constructor called\n";
- }
-
-
- //--------------------------------------- Derived
-
- class Derived : public Base1, public Base2
- {
- public:
- Derived();
- };
-
- Derived::Derived()
- {
- cout << "Derived constructor called\n";
- }
-
-
- //--------------------------------------- main()
-
- int main()
- {
- Derived myDerived;
-
- return 0;
- }